
module.exports = function (postUrl,field,row,callback) {
    this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
    })
        .then(() => {
            fetch(`/api/${postUrl}`, {
                method: "post",
                body: field+"=" + row[field],
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded",
                },
            })
                .then((res) => res.json())
                .then((res) => {
                    if (res.status == "0") {
                        this.$message({
                            type: "success",
                            message: "删除成功!",
                        });
                        callback()
                    } else {
                        this.$message({
                            type: "error",
                            message: "删除失败,请稍后再试！",
                        });
                    }
                });
        })
        .catch(() => {
            this.$message({
                type: "info",
                message: "已取消删除",
            });
        });
}
